package com.etalk.crm.client.interfaces;

import com.etalk.crm.client.fallbacks.SmsMessageClientHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Jordan
 */
@FeignClient(name="${feign.client.message.name}",url = "${feign.client.message.url}",fallback= SmsMessageClientHystrix.class)
public interface SmsMessageClient {

    /**
     * crm发送模板消息
     * @param templateId 消息模板id
     * @param params 参数组(信息接收手机，变量1、变量2、变量3......依次类推)
     * @return 发送结果
     */
    @PostMapping(value = "/sms/chuanglan/template/{templateId}")
    String sendSmsTemplateMessage(@PathVariable("templateId") int templateId, @RequestParam("params") String params);

    /**
     * 抢单后自动推送短信给用户
     * @param phone 电话
     * @param ccName 抢单人名称
     * @param contactTime 联系时间
     * @return 结果
     */
    @PostMapping(value = "/sms/chuanglan/grab/student")
    String sendGrabTheOrderSms(@RequestParam("phone")String phone, @RequestParam("ccName")String ccName, @RequestParam("contactTime")String contactTime);
}
